<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>cs229 第七节 | Dirac Lee</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noodp" />
<meta name="Description" content="cs229 第七节"><link rel="prev" href="https://diraclee.gitee.io/2020/10/cs229_lecture6/" /><link rel="next" href="https://diraclee.gitee.io/2020/10/cs229_lecture8/" /><link rel="canonical" href="https://diraclee.gitee.io/2020/10/cs229_lecture7/" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff"><meta property="og:title" content="cs229 第七节" />
<meta property="og:description" content="cs229 第七节" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://diraclee.gitee.io/2020/10/cs229_lecture7/" />
<meta property="article:published_time" content="2020-10-14T00:00:00+00:00" />
<meta property="article:modified_time" content="2020-10-17T00:00:00+00:00" />
<script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "cs229 第七节",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https:\/\/diraclee.gitee.io\/2020\/10\/cs229_lecture7\/"
        },"image": {
                "@type": "ImageObject",
                "url": "https:\/\/diraclee.gitee.io\/logo.png",
                "width":  800 ,
                "height":  600 
            },"genre": "posts","keywords": "机器学习, cs229","wordcount":  2242 ,
        "url": "https:\/\/diraclee.gitee.io\/2020\/10\/cs229_lecture7\/","datePublished": "2020-10-14T00:00:00\x2b00:00","dateModified": "2020-10-17T00:00:00\x2b00:00","license": "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.","publisher": {
                "@type": "Organization",
                "name": "xxxx",
                "logo": {
                "@type": "ImageObject",
                "url": "https:\/\/diraclee.gitee.io\/logo.png",
                "width":  127 ,
                "height":  40 
                }
            },"description": "cs229 第七节"
    }
    </script><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="/css/lib/fontawesome-free/all.min.css"><link rel="stylesheet" href="/css/lib/animate/animate.min.css"></head>
    <body><script>
            window.isDark = (window.localStorage && window.localStorage.getItem('theme')) === 'dark';
            window.isDark && document.body.classList.add('dark-theme');
        </script><div class="wrapper"><nav class="navbar">
    <div class="navbar-container">
        <div class="navbar-header animated bounceIn">
            <a href="https://diraclee.gitee.io">Dirac Lee</a>
        </div>
        <div class="navbar-menu"><a class="menu-item" href="https://diraclee.gitee.io/posts" title="">文章</a><a class="menu-item" href="https://diraclee.gitee.io/tags" title="">标签</a><a class="menu-item" href="https://diraclee.gitee.io/categories" title="">分类</a><a class="menu-item" href="https://diraclee.gitee.io/about" title="">关于</a><a class="menu-item" href="https://diraclee.gitee.io" title="English"><i class="fas fa-language fa-fw"></i></a><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="切换主题"></i></a>
        </div>
    </div>
</nav><nav class="navbar-mobile">
    <div class="navbar-container">
        <div class="navbar-header">
            <div class="navbar-header-title animated bounceIn">
                <a href="https://diraclee.gitee.io">Dirac Lee</a>
            </div>
            <div class="menu-toggle" id="menu-toggle">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="navbar-menu" id="mobile-menu"><a class="menu-item" href="https://diraclee.gitee.io/posts" title="">文章</a><a class="menu-item" href="https://diraclee.gitee.io/tags" title="">标签</a><a class="menu-item" href="https://diraclee.gitee.io/categories" title="">分类</a><a class="menu-item" href="https://diraclee.gitee.io/about" title="">关于</a><a class="menu-item" href="https://diraclee.gitee.io" title="English"></a><a href="javascript:void(0);" class="theme-switch"><i class="fas fa-adjust fa-rotate-180 fa-fw" title="切换主题"></i></a>
        </div>
    </div>
</nav><main class="main">
                <div class="container"><article class="page"><h1 class="post-title animated flipInX">cs229 第七节</h1><div class="post-meta">
            <div class="post-meta-main"><a class="author" href="https://diraclee.gitee.io" rel="author" target="_blank">
                    <i class="fas fa-user-circle fa-fw"></i>Dirac Lee
                </a>&nbsp;<span class="post-category">收录于&nbsp;<i class="far fa-folder fa-fw"></i><a href="https://diraclee.gitee.io/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a>&nbsp;</span></div>
            <div class="post-meta-other"><i class="far fa-calendar-alt fa-fw"></i><time datetime=2020-10-14>2020-10-14</time>&nbsp;
                <i class="fas fa-pencil-alt fa-fw"></i>约 2242 字&nbsp;
                <i class="far fa-clock fa-fw"></i>预计阅读 5 分钟&nbsp;</div>
        </div><div class="post-content"><p>大纲</p>
<ul>
<li>朴素贝叶斯
<ul>
<li>拉普拉斯平滑</li>
<li>事件模型 (event models)</li>
</ul>
</li>
<li>机器学习应用经验</li>
<li>SVM 介绍</li>
</ul>
<a class="post-dummy-target" id="朴素贝叶斯"></a><h2>朴素贝叶斯</h2>
<a class="post-dummy-target" id="邮件分类问题-回顾"></a><h3>邮件分类问题 (回顾)</h3>
<p>数据表示</p>
<p>$$
x = 
\begin{bmatrix}
1 \\ 
0 \\ 
\vdots \\ 
1 \\ 
\vdots
\end{bmatrix}
\begin{matrix}
a \\ 
aardvark \\ 
\vdots \\ 
buy \\ 
\vdots
\end{matrix}
$$</p>
<p>$$
x_j = I(第 j 个单词出现在邮件中)
$$</p>
<a class="post-dummy-target" id="生成模型-回顾"></a><h3>生成模型 (回顾)</h3>
<p>求解 $P(x|y)$ 和 $P(y)$</p>
<p>则 $P(x|y) = \prod_{j=1}^n P(x_j|y)$</p>
<p>简略符号</p>
<ul>
<li>$P(y=1) = \phi_y$</li>
<li>$P(x_j=1 | y=0) = \phi_{j|y=0}$</li>
<li>$P(x_j=1 | y=1) = \phi_{j|y=1}$</li>
</ul>
<p>则</p>
<p>$$
\phi_y = \frac { \sum_{i=1}^m I( y^{(i)} = 1 ) } m
$$</p>
<p>$$
\phi_{j | y=0} = \frac { \sum_{i=1}^m I( x^{(i)}_j = 1, y^{(i)} = 1 ) } { \sum_{i=1}^m I( y^{(i)} = 1 )   }
$$</p>
<p>预测阶段</p>
<p>$$
P(y = 1 | x) = \frac { P(x | y=1) P(y=1) } { P(x | y=1) P(y=1) + P(x | y=0) P(y = 0) }
$$</p>
<p>大多数情况下该模型可以运行得很好，但也有极端情况。</p>
<p>对于单词 NIPS，其编号为 j = 6017，它没有在任何一封邮件中出现过，那么采用以上算法得到结果如下</p>
<p>$$
P(x_{6017}=1 | y=1) = \frac { \phi_{6017 | y=1} } { cnt(y=1) } = 0
$$</p>
<p>$$
P(x_{6017}=1 | y=0) = \frac { \phi_{6017 | y=0} } { cnt(y=0) } = 0
$$</p>
<p>从而得到</p>
<p>$$
P(y=1 | x_{6017}) = \frac 0 { 0 + 0 } = 0
$$</p>
<p>这个结论显然是荒谬的！</p>
<a class="post-dummy-target" id="拉普拉斯平滑"></a><h3>拉普拉斯平滑</h3>
<p>我们再看另一个例子，吴恩达教授所在的斯坦福大学足球队今年比赛成绩如下</p>
<table>
<thead>
<tr>
<th>比赛日期</th>
<th>对手</th>
<th>是否胜利</th>
</tr>
</thead>
<tbody>
<tr>
<td>9月12日</td>
<td>Wake Forest</td>
<td>0</td>
</tr>
<tr>
<td>10月10日</td>
<td>OSU</td>
<td>0</td>
</tr>
<tr>
<td>10月17日</td>
<td>Aritona</td>
<td>0</td>
</tr>
<tr>
<td>11月21日</td>
<td>Caltel</td>
<td>0</td>
</tr>
<tr>
<td>12月31日</td>
<td>Oklahoma</td>
<td>？</td>
</tr>
</tbody>
</table>
<p>根据朴素贝叶斯算法，得到对决 Oklahoma 大学的胜率为</p>
<p>$$
P(x = 1) = \frac { cnt(&ldquo;1&rdquo;) } { cnt(&ldquo;1&rdquo;) + cnt(&ldquo;0&rdquo;) } = \frac 0 {0 + 0} = 0
$$</p>
<p>显然斯坦福大学足球队不会承认这种推断！</p>
<p>我们可以提前对比赛结果进行预设，假设实际比赛前斯坦福大学足球队在某个宇宙中已经赢了一把，输了一把，如此预测他们对决 Oklahoma 大学的胜率为
$$
P(x = 1) = \frac { cnt(&ldquo;1&rdquo;) + 1 } { cnt(&ldquo;1&rdquo;) + 1 + cnt(&ldquo;0&rdquo;) + 1 } = \frac 1 2
$$</p>
<p>这个预测结果看起来更合理一些。</p>
<p>而这种对朴素贝叶斯的优化方法就称为拉普拉斯平滑。</p>
<p>它更广义的形式如下：</p>
<p>对于
$$
x \in \lbrace 1, 2, &hellip;, k \rbrace
$$</p>
<p>算法预测 $x=j$ 的概率为</p>
<p>$$
P(x = j) = \frac { \sum_{j=1}^m I(x^{(i)} = j) + 1 } { m + k }
$$</p>
<p>$$
\phi_{j | y=0} = \frac { \sum_{i=1}^m I( x^{(i)}_j = 1, y^{(i)} = 0 ) + 1 } { \sum_{i=1}^m I( y^{(i)} = 0 ) + 2  }
$$</p>
<p>顺便说一下，斯坦福大学足球队最终输给了 Oklahoma 大学^_^</p>
<a class="post-dummy-target" id="事件模型"></a><h3>事件模型</h3>
<p>当特征是多项式值</p>
<p>$$
x \in \lbrace 1, 2, &hellip;, k \rbrace
$$</p>
<p>例如房价预测问题，我们可以用将房屋面积划分为几个区间，并用单个数字来代表每一个区间，例如</p>
<table>
<thead>
<tr>
<th>size(feet<sup>2</sup>)</th>
<th>&lt;400</th>
<th>400~800</th>
<th>800~1200</th>
<th>1200&lt;</th>
</tr>
</thead>
<tbody>
<tr>
<td>x<sub>i</sub></td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table>
<p>这样以来我们就可以使用朴素贝叶斯来解决这个问题</p>
<p>$$
P(x | y) = \prod_{j=1}^n \underbrace{P(x_j | y)  }_{\text{ 多项式概率 }}
$$</p>
<a class="post-dummy-target" id="多元伯努利事件模型"></a><h4>多元伯努利事件模型</h4>
<p>例如邮件内容为 &ldquo;Drugs! Buy drugs now!&quot;，特征可表示如下</p>
<p>$$
x = 
\begin{bmatrix}
0 \\ 
0 \\ 
\vdots \\ 
1 \\ 
\vdots \\ 
1 \\ 
\vdots \\ 
1 \\ 
\vdots
\end{bmatrix}
\begin{matrix}
a \\ 
aardvark \\ 
\vdots \\ 
buy \\ 
\vdots \\ 
drugs \\ 
\vdots \\ 
now \\ 
\vdots
\end{matrix}
\begin{matrix}
\leftarrow 1 \\ 
\leftarrow 2 \\ 
\vdots \\ 
\leftarrow 800 \\ 
\vdots \\ 
\leftarrow 1600 \\ 
\vdots \\ 
\leftarrow 6200 \\ 
\vdots
\end{matrix}
$$</p>
<p>其中</p>
<ul>
<li>第二列为单词字面值</li>
<li>第三列为单词的字典序 k，以后就用其代表单词</li>
<li>$x_k \in \lbrace 0, 1 \rbrace$ 表示单词 k 是否出现过</li>
</ul>
<a class="post-dummy-target" id="多项式事件模型"></a><h4>多项式事件模型</h4>
<p>邮件内容仍然是 &ldquo;Drugs! Buy drugs now!&quot;，特征表示为</p>
<p>$$
x = 
\begin{bmatrix}
1600 \\ 
800 \\ 
1600 \\ 
6200
\end{bmatrix}
\in \R^{n_i}
$$</p>
<p>假设我们的字典种一共有 10000 个单词，那么</p>
<ul>
<li>$x_i \in \lbrace 1, 2, \dots, 10000 \rbrace$ 表示邮件中的第 i 个单词</li>
<li>$n_i$ 表示第 i 封邮件的长度</li>
</ul>
<p>假设 $x_i$ 之间关于 $y$ 是条件独立的，那么</p>
<p>$$
P(x, y) = P(x | y) P(y) \xlongequal{assume} \prod_{j=1}^n P(x_j | y) P(y)
$$
令
$$
\phi_i = P(y = 1)
$$</p>
<p>$$
\phi_{k|y=0} = \underbrace{P(x_j = k | y = 0) }_{\text{ 已知 y=0, 第 j 个单词是 k 的概率 }}
$$</p>
<p>$$
\phi_{k | y = 1} = P(x_j = k | y = 1)
$$</p>
<p>MLE</p>
<p>$$
\phi_{k | y=0} = \frac { \overbrace{ \sum_{i=1}^m I(  y^{(i)} = 0 ) \sum_{j=1}^{n_i} I( x^{(i)}_j = k )  }^{\text{ 所有非垃圾邮件中单词 k 出现的总次数 }}  + 1 } {  \underbrace{ \sum_{i=1}^m I( y^{(i)} = 0 ) \cdot n_i  }_{\text{ 所有非垃圾邮件的总字数 }} + 10000  }
$$</p>
<p>当邮件中包含我们字典中没有的单词时，统统视为 <code>&lt;UNK&gt;</code>，即 unknown words</p>
<a class="post-dummy-target" id="机器学习应用经验"></a><h2>机器学习应用经验</h2>
<blockquote>
<p>如果你想让一个应用软件运行起来</p>
<p>在最开始：使用粗糙但搭建快速的算法（如朴素贝叶斯）</p>
<p>然后：训练并使用它，设法优化该算法</p>
<p>然后：在此基础上持续迭代</p>
<p>在应用上线之前我们永远不会知道最棘手的部分是什么</p>
</blockquote>
<p>一些垃圾邮件制造者可能会设法躲避我们模型的检测，如单词 <code>mortgage</code> 很容易被算法模型检测为非法单词，从而判断其为垃圾邮件。但这些人可能把它写成 m$\odot$rtg/\ge 而被算法模型判定为 <code>&lt;UNK&gt;</code>，从而躲避检测。可以通过将该单词手动添加到词典，设置其为 <code>mortgage</code> 的同义词来解决。</p>
<p>还有邮件头欺骗 (spoofed headers) 等问题，可以尝试用 word embedding (CS230, CS224N) 来解决。</p>
<p>这些简单的算法，数据需求量较小，构建模型快，很适合刚开始做一个算法项目时使用。</p>
<a class="post-dummy-target" id="支持向量机-svm"></a><h2>支持向量机 (SVM)</h2>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201016122946.png" alt="" class="lazyload"></figure></p>
<p>$$
x = 
\begin{bmatrix}
x_1 \\ 
x_2
\end{bmatrix}
\longrightarrow
\phi (x) = 
\begin{bmatrix}
x_1 \\ 
\\ 
x_2 \\ 
\\ 
x_1^2 \\ 
\\ 
x_1^2 \\ 
\\ 
x_1 x_2 \\ 
\end{bmatrix}
$$</p>
<ul>
<li>
<p>最佳边界分类器（可分离情况）</p>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201016123406.png" alt="" class="lazyload"></figure></p>
</li>
<li>
<p>Kernels</p>
<p>$x \in R^2 \longrightarrow \phi (x) \in R^\infin$</p>
</li>
<li>
<p>不可分离情况</p>
</li>
</ul>
<a class="post-dummy-target" id="函数边界"></a><h3>函数边界</h3>
<p>对某个样本进行分类的自信程度和准确程度(confidently and accuracily)</p>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/logistic_.png" alt="" class="lazyload"></figure></p>
<p>$$
h_\theta (x) = g(\theta^T x)
$$</p>
<ul>
<li>
<p>如果 $\theta^T x &gt; 0$ (即 $h_\theta (x) \ge 0.5$)，预测结果为 &ldquo;1&rdquo;</p>
</li>
<li>
<p>否则，预测结果为 &ldquo;0&rdquo;</p>
</li>
</ul>
<p>换句话说</p>
<ul>
<li>
<p>如果 $y^{(i)} = 1$ ，我们希望 $\theta^T x^{(i)} \ggg 0$</p>
</li>
<li>
<p>如果 $y^{(i)} = 0$ ，我们希望 $\theta^T x^{(i)} \lll 0$</p>
</li>
</ul>
<a class="post-dummy-target" id="几何边界"></a><h3>几何边界</h3>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201016133232.png" alt="" class="lazyload"></figure></p>
<p>数据表示</p>
<ul>
<li>标签 $y \in \lbrace -1, +1 \rbrace $</li>
<li>模型输出值必须 $\in \lbrace -1, +1 \rbrace$，$g(z) = \begin{cases} +1, &amp;&amp; \theta^T x &gt; 0 \\ 
-1, &amp;&amp; otherwise \end{cases}$</li>
</ul>
<p>我们之前得到的逻辑回归中，参数为 $\theta = \begin{bmatrix} \theta_0 \\ \theta_1 \\ \vdots \\ \theta_n \end{bmatrix} $，判定函数如下</p>
<p>$$
h_\theta (x) = g(\theta^T x) \qquad where \quad x_0 = 1
$$</p>
<p>相比较而言， SVM 的判定函数去除了 $x_0 = 1$ 的规约，而使用 weight - bias 来表示参数</p>
<p>$$
h_{w, b} = g(w^T x + b)
$$</p>
<a class="post-dummy-target" id="函数边界-1"></a><h3>函数边界</h3>
<p>由关于  $(x^{(i)}, y^{(i)})$ 的 $(w, b)$ 所定义的高维平面的函数边界</p>
<p>$$
\hat \gamma^{(i)} = y^{(i)} (w^T x^{(i)} + b)
$$</p>
<p>如果  $\hat \gamma^{(i)} \gt 0$ 那就意味着 $h(x^{(i)}) = y^{(i)}$</p>
<p>那么我们就要让 $\hat \gamma^{(i)} \ggg 0$</p>
<p>如果 $y^{(i)} = +1$，我们就希望 $ w^T x^{(i)} + b \ggg 0 $</p>
<p>如果 $y^{(i)} = -1$，我们就希望 $ w^T x^{(i)} + b \lll 0 $</p>
<p>关于训练集的函数边界（假设线性可分）
$$
\hat \gamma = \min_i \hat \gamma^{(i)} \quad i = 1, 2, &hellip;, m
$$</p>
<a class="post-dummy-target" id="几何边界-1"></a><h3>几何边界</h3>
<p><figure><img src="/svg/loading.min.svg" data-sizes="auto" data-src="https://gitee.com/DiracLee/picbed/raw/master/img/20201016142013.png" alt="" class="lazyload"></figure></p>
<p>由关于  $(x^{(i)}, y^{(i)})$ 的 $(w, b)$ 所定义的高维平面的几何边界
$$
\gamma^{(i)} = \frac { ||w^T x^{(i)} + b|| } {||w||} = \frac { y^{(i)} ( w^T x^{(i)} + b ) } {||w||} = \frac { \hat \gamma^{(i)}} {|| w ||}
$$</p>
<p>关于训练集的几何边界
$$
\gamma = \min_i \gamma^{(i)}
$$</p>
<blockquote>
<p>标记解释</p>
<ul>
<li>$\hat \gamma$  函数边界</li>
<li>$\gamma$  几何边界</li>
</ul>
</blockquote>
<a class="post-dummy-target" id="最优边界分类器"></a><h3>最优边界分类器</h3>
<p>选择合适的 $w$ 和 $b$ 来最大化 $\gamma$</p>
<p>等比例缩放 $w$ 和 $b$，所得到的高维分界面不会发生改变</p>
<p>缩放 $(w, b) \longrightarrow (\frac w { \gamma ||w|| }, \frac b { \gamma ||w|| })  \eqqcolon  (w, b) $ ，那么该分界面的新参数满足 $||w|| = \frac 1 \gamma$</p>
<p>因此</p>
<p>$$
\begin{cases}
\arg \max_{w, b} \gamma  \\ \\ 
s.t. \quad \frac {y^{(i)} ( w^T x^{(i)} + b ) } {||w||} \ge \gamma 
\end{cases}
\iff 
\begin{cases}
\arg \min_{w, b} ||w||^2  \\ \\ 
s.t. \quad {y^{(i)} ( w^T x^{(i)} + b})  \ge 1 
\end{cases}
$$</p>
<a class="post-dummy-target" id="参考"></a><h2>参考</h2>
<p><a href="https://katex.org/docs/supported.html" target="_blank">$\KaTeX$ 文档</a></p></div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>本文于 2020-10-17 更新</span>
            </div>
            <div class="post-info-license"></div>
        </div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share"><span><a href="//www.linkedin.com/shareArticle?url=https%3a%2f%2fdiraclee.gitee.io%2f2020%2f10%2fcs229_lecture7%2f&amp;title=cs229%20%e7%ac%ac%e4%b8%83%e8%8a%82" target="_blank" title="分享到 LinkedIn">
            <i class="fab fa-linkedin fa-fw"></i>
        </a><a href="//service.weibo.com/share/share.php?url=https%3a%2f%2fdiraclee.gitee.io%2f2020%2f10%2fcs229_lecture7%2f&amp;appkey=&amp;title=cs229%20%e7%ac%ac%e4%b8%83%e8%8a%82" target="_blank" title="分享到 Weibo">
            <i class="fab fa-weibo fa-fw"></i>
        </a></span></div>
        </div>
    </div>

    <div class="post-info-more">
        <section><span class="tag">
                        <a href="https://diraclee.gitee.io/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"><i class="fas fa-tag fa-fw"></i>&nbsp;机器学习</a>&nbsp;
                    </span><span class="tag">
                        <a href="https://diraclee.gitee.io/tags/cs229/"><i class="fas fa-tag fa-fw"></i>&nbsp;cs229</a>&nbsp;
                    </span></section>
        <section>
            <span><a href="javascript:window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="https://diraclee.gitee.io">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="https://diraclee.gitee.io/2020/10/cs229_lecture6/" class="prev" rel="prev" title="cs229 第六节"><i class="fas fa-angle-left fa-fw"></i>cs229 第六节</a>
            <a href="https://diraclee.gitee.io/2020/10/cs229_lecture8/" class="next" rel="next" title="cs229 第八节">cs229 第八节<i class="fas fa-angle-right fa-fw"></i></a></div>
</div><div class="post-comment"></div>
    </article></div>
            </main><footer class="footer">
    <div class="copyright"><div class="copyright-line">由 <a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
        </div>

        <div class="copyright-line"><i class="far fa-copyright fa-fw"></i><span itemprop="copyrightYear">2020</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="https://diraclee.gitee.io" target="_blank">Dirac Lee</a></span>&nbsp;|&nbsp;<span class="license"><a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a></span></div>
    </div>
</footer></div><a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
            <span>&nbsp;</span>
        </a><script src="/js/lib/jquery/jquery.slim.min.js"></script><script src="/js/lib/lazysizes/lazysizes.min.js"></script><script src="/js/lib/smooth-scroll/smooth-scroll.polyfills.min.js"></script><script>window.scroll = new SmoothScroll('[data-scroll]', {speed: 300, speedAsDuration: true});</script><link rel="stylesheet" href="/css/lib/katex/katex.min.css"><script src="/js/lib/katex/katex.min.js"></script><script defer src="/js/lib/katex/auto-render.min.js"></script><link rel="stylesheet" href="/css/lib/katex/copy-tex.min.css"><script defer src="/js/lib/katex/copy-tex.min.js"></script><script defer src="/js/lib/katex/mhchem.min.js"></script><script>
        document.addEventListener("DOMContentLoaded", function () {
            renderMathInElement(document.body, {
                delimiters: [
                    { left: "$$", right: "$$", display: true },
                    { left: "\\(", right: "\\)", display: false },
                    { left: "\\[", right: "\\]", display: true },{ left: "$", right: "$", display: false },]
            });
        });
    </script><script src="/js/blog.min.js"></script></body>
</html>